import axios from 'axios';
import {requestInterceptor, handleError, responseInterceptor} from "./interceptor";

/* 环境区分 */
const env = import.meta.env;
//创建axios实例对象
const request = axios.create({
	baseURL: env.VITE_API_BASE_URL_v2,
	timeout: 0
});


//设置请求拦截器
request.interceptors.request.use(requestInterceptor, handleError);

//设置响应拦截器
request.interceptors.response.use(responseInterceptor, handleError);

export default request;
